<!DOCTYPE html>
<meta charset="utf-8">
<#include "../../business/common/common.ftl"/>

<style>
    div {
        overflow: scroll;
    }

</style>
<div class="layui-fluid">
    <table class="layui-table table" style="text-align: center;font-size: 10px" id="dataTable" tableType="dataTable">
        <tr class="layui-bg-gray">
            <th style="text-align: center;" rowspan="3">序号</th>
            <th style="text-align: center;" colspan="4">基础信息</th>
            <th style="text-align: center;" colspan="25">选房情况</th>
        </tr>
        <tr class="layui-bg-gray">
            <th style="text-align: center;" rowspan="2">年份</th>
            <th style="text-align: center;" colspan="3">征迁安置情况</th>
            <th style="text-align: center;" colspan="2">小户型</th>
            <th style="text-align: center;" colspan="12">普通型</th>
            <th style="text-align: center;" colspan="2">复式</th>
            <th style="text-align: center;" colspan="2">房源合计</th>
            <th style="text-align: center;" colspan="2">店铺</th>
            <th style="text-align: center;" colspan="2">储物间</th>
            <th style="text-align: center;" colspan="3">车位数</th>
        </tr>
        <tr class="layui-bg-gray">
            <th style="text-align: center;">片区</th>
            <th style="text-align: center;">项目数</th>
            <th style="text-align: center;">户数</th>
            <th style="text-align: center;">一室(套)</th>
            <th style="text-align: center;">面积(㎡)</th>
            <th style="text-align: center;">一室二厅(套)</th>
            <th style="text-align: center;">面积(㎡)</th>
            <th style="text-align: center;">二室二厅(套)</th>
            <th style="text-align: center;">面积(㎡)</th>
            <th style="text-align: center;">三室二厅(套)</th>
            <th style="text-align: center;">面积(㎡)</th>
            <th style="text-align: center;">四室二厅(套)</th>
            <th style="text-align: center;">面积(㎡)</th>
            <th style="text-align: center;">五室二厅(套)</th>
            <th style="text-align: center;">面积(㎡)</th>
            <th style="text-align: center;">数量(套)</th>
            <th style="text-align: center;">面积(㎡)</th>
            <th style="text-align: center;">复式(套)</th>
            <th style="text-align: center;">面积(㎡)</th>
            <th style="text-align: center;">数量(套)</th>
            <th style="text-align: center;">面积(㎡)</th>

            <th style="text-align: center;">数量(套)</th>
            <th style="text-align: center;">面积(㎡)</th>
            <th style="text-align: center;">数量(套)</th>
            <th style="text-align: center;">面积(㎡)</th>
            <th style="text-align: center;">普通车位</th>
            <th style="text-align: center;">人防车位</th>
            <th style="text-align: center;">车位合计</th>

        </tr>
    <#assign index = 0/>
    <#assign allContractCountSum = 0/>
    <#assign allZsProjectCountSum = 0/>
    <#assign allMoreCountSum = 0/>
    <#assign allMoreMoneySum = 0/>
    <#assign allLessCountSum = 0/>
    <#assign allLessMoneySum = 0/>
    <#assign allFinalMoneySum = 0/>
    <#assign allSmallHouseCountSum = 0/>
    <#assign allSmallHouseAreaSum = 0/>
    <#assign all0100HouseCountSum = 0/>
    <#assign all0100HouseAreaSum = 0/>
    <#assign all0102HouseCountSum = 0/>
    <#assign all0102HouseAreaSum = 0/>
    <#assign all0202HouseCountSum = 0/>
    <#assign all0202HouseAreaSum = 0/>
    <#assign all0302HouseCountSum = 0/>
    <#assign all0302HouseAreaSum = 0/>
    <#assign all0402HouseCountSum = 0/>
    <#assign all0402HouseAreaSum = 0/>
    <#assign all0502HouseCountSum = 0/>
    <#assign all0502HouseAreaSum = 0/>
    <#assign allNormalHouseCountSum = 0/>
    <#assign allNormalHouseAreaSum = 0/>
    <#assign allFsHouseCountSum = 0/>
    <#assign allFsHouseAreaSum = 0/>
    <#assign allHouseCountSum = 0/>
    <#assign allHouseAreaSum = 0/>

    <#assign allShopHouseCountSum = 0/>
    <#assign allShopHouseAreaSum = 0/>
    <#assign allStorageRoomCountSum = 0/>
    <#assign allStorageRoomAreaSum = 0/>
    <#assign allCarLotCountSum = 0/>
    <#assign allPtCarLotCountSum = 0/>
    <#assign allRfCarLotCountSum = 0/>
    <#assign town = townCode />

    <#if yearList?size !=0>
        <#list yearList as year>
            <#assign yearMap = (resultMap[year])!/>
            <#assign storageRoomYearMap = (storageRoomMap[year])!/>
            <#assign shopHouseYearMap = (shopHouseMap[year])!/>
            <#assign carLotYearMap = (carLotMap[year])!/>

            <#list yearMap?keys as key>
                <#assign yearTownMap = (yearMap[key])/>
                <#assign allZsProjectCountSum = allZsProjectCountSum + yearTownMap['zspCount']/>
                <#assign allContractCountSum = allContractCountSum + yearTownMap['contractCount']/>
                <#assign allSmallHouseCountSum = allSmallHouseCountSum + yearTownMap['smallHouseNum']/>
                <#assign allSmallHouseAreaSum = allSmallHouseAreaSum + yearTownMap['smallHouseArea']/>
                <#assign all0102HouseCountSum = all0102HouseCountSum + yearTownMap['0102HouseNum']/>
                <#assign all0102HouseAreaSum = all0102HouseAreaSum + yearTownMap['0102HouseArea']/>
                <#assign all0202HouseCountSum = all0202HouseCountSum + yearTownMap['0202HouseNum']/>
                <#assign all0202HouseAreaSum = all0202HouseAreaSum + yearTownMap['0202HouseArea']/>
                <#assign all0302HouseCountSum = all0302HouseCountSum + yearTownMap['0302HouseNum']/>
                <#assign all0302HouseAreaSum = all0302HouseAreaSum+ yearTownMap['0302HouseArea']/>
                <#assign all0402HouseCountSum = all0402HouseCountSum + yearTownMap['0402HouseNum']/>
                <#assign all0402HouseAreaSum = all0402HouseAreaSum + yearTownMap['0402HouseArea']/>
                <#assign all0502HouseCountSum = all0502HouseCountSum + yearTownMap['0502HouseNum']/>
                <#assign all0502HouseAreaSum = all0502HouseAreaSum + yearTownMap['0502HouseArea']/>
                <#assign allNormalHouseCountSum = allNormalHouseCountSum + yearTownMap['normalHouseNum']/>
                <#assign allNormalHouseAreaSum = allNormalHouseAreaSum + yearTownMap['normalHouseArea']/>
                <#assign allFsHouseCountSum = allFsHouseCountSum + yearTownMap['fsHouseNum']/>
                <#assign allFsHouseAreaSum = allFsHouseAreaSum + yearTownMap['fsHouseArea']/>
                <#assign allHouseCountSum = allHouseCountSum + yearTownMap['houseNum']/>
                <#assign allHouseAreaSum = allHouseAreaSum + yearTownMap['houseArea']/>
                <#assign allShopHouseCountSum = allShopHouseCountSum + (shopHouseYearMap[key]['shopHouseNum'])!0/>
                <#assign allShopHouseAreaSum = allShopHouseAreaSum + (shopHouseYearMap[key]['shopHouseArea'])!0/>
                <#assign allStorageRoomCountSum = allStorageRoomCountSum + (storageRoomYearMap[key]['storageRoomNum'])!0/>
                <#assign allStorageRoomAreaSum = allStorageRoomAreaSum + (storageRoomYearMap[key]['storageRoomArea'])!0/>
                <#assign allCarLotCountSum = allCarLotCountSum + (carLotYearMap[key]['carLotNum'])!0/>
                <#assign allPtCarLotCountSum = allPtCarLotCountSum + (carLotYearMap[key]['ptCarLotNum'])!0/>
                <#assign allRfCarLotCountSum = allRfCarLotCountSum + (carLotYearMap[key]['rfCarLotNum'])!0/>
                <#assign index = index+1 />
                <#if town??>
                    <#assign townCode = yearTownMap['town'] />
                </#if>
                <tr <#if index%10 lte 5 && index%10 gt 0>style="background-color: #FFCC99"</#if>>
                    <td>${index}</td>
                    <td><a href="azChooseHouseForTownByYear.ftl?yearStr=${year}&townCode=${town}"
                           style="font: inherit">${year}年</a></td>
                    <td>${((townMap[yearTownMap['town']]).name)!}</a>
                    </td>
                    <td><a href="zsChooseHouseByYear.ftl?yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['zspCount']}</td>
                    <td><a href="contractShow.ftl?yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['contractCount']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=02&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['smallHouseNum']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=02&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['smallHouseArea']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&houseHold=0102&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['0102HouseNum']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&houseHold=0102&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['0102HouseArea']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&houseHold=0202&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['0202HouseNum']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&houseHold=0202&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['0202HouseArea']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&houseHold=0302&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['0302HouseNum']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&houseHold=0302&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['0302HouseArea']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&houseHold=0402&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['0402HouseNum']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&houseHold=0402&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['0402HouseArea']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&houseHold=0502&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['0502HouseNum']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&houseHold=0502&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['0502HouseArea']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['normalHouseNum']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=01&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['normalHouseArea']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=03&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['fsHouseNum']}</td>
                    <td><a href="selectedHouseShow.ftl?houseType=03&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['fsHouseArea']}</td>
                    <td><a href="selectedHouseShow.ftl?yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['houseNum']}</td>
                    <td><a href="selectedHouseShow.ftl?yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${yearTownMap['houseArea']}</td>

                    <td><a href="selectedShopHouseShow.ftl?yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${(shopHouseYearMap[key]['shopHouseNum'])!0}</td>
                    <td><a href="selectedShopHouseShow.ftl?yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${(shopHouseYearMap[key]['shopHouseArea'])!0}</td>
                    <td><a href="selectedStorageRoomShow.ftl?yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${(storageRoomYearMap[key]['storageRoomNum'])!0}</td>
                    <td><a href="selectedStorageRoomShow.ftl?yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${(storageRoomYearMap[key]['storageRoomArea'])!0}</td>
                    <td><a href="selectedCarLotShow.ftl?carLotType=1,2,3&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${(carLotYearMap[key]['ptCarLotNum'])!0}</td>
                    <td><a href="selectedCarLotShow.ftl?carLotType=4,5,6&yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${(carLotYearMap[key]['rfCarLotNum'])!0}</td>
                    <td><a href="selectedCarLotShow.ftl?yearStr=${year}&townCode=${townCode}"
                           style="font: inherit">${(carLotYearMap[key]['carLotNum'])!0}</td>
                </tr>

            </#list>
        </#list>
    </#if>
        <tr bgcolor="#b0c4de">
            <td colspan="4">合计${town}</a></td>

            <td><a href="contractShow.ftl?&townCode=${town}"
                   style="font: inherit">${allContractCountSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseType=02&townCode=${town}"
                   style="font: inherit">${allSmallHouseCountSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseType=02&townCode=${town}"
                   style="font: inherit">${allSmallHouseAreaSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseHold=0102&townCode=${town}"
                   style="font: inherit">${all0102HouseCountSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseHold=0102&townCode=${town}"
                   style="font: inherit">${all0102HouseAreaSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseHold=0202&houseType=01&townCode=${town}"
                   style="font: inherit">${all0202HouseCountSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseHold=0202&houseType=01&townCode=${town}"
                   style="font: inherit">${all0202HouseAreaSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseHold=0302&houseType=01&townCode=${town}"
                   style="font: inherit">${all0302HouseCountSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseHold=0302&houseType=01&townCode=${town}"
                   style="font: inherit">${all0302HouseAreaSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseHold=0402&houseType=01&townCode=${town}"
                   style="font: inherit">${all0402HouseCountSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseHold=0402&houseType=01&townCode=${town}"
                   style="font: inherit">${all0402HouseAreaSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseHold=0502&houseType=01&townCode=${town}"
                   style="font: inherit">${all0502HouseCountSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseHold=0502&houseType=01&townCode=${town}"
                   style="font: inherit">${all0502HouseAreaSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseType=01&townCode=${town}"
                   style="font: inherit">${allNormalHouseCountSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseType=01&townCode=${town}"
                   style="font: inherit">${allNormalHouseAreaSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseType=03&townCode=${town}"
                   style="font: inherit">${allFsHouseCountSum}
            </td>
            <td>
                <a href="selectedHouseShow.ftl?houseType=03&townCode=${town}"
                   style="font: inherit">${allFsHouseAreaSum}
            </td>
            <td><a href="selectedHouseShow.ftl?townCode=${town}" style="font: inherit">${allHouseCountSum}</td>
            <td><a href="selectedHouseShow.ftl?townCode=${town}" style="font: inherit">${allHouseAreaSum}</td>
            <td><a href="selectedShopHouseShow.ftl?townCode=${town}"
                   style="font: inherit">${allShopHouseCountSum}</td>
            <td><a href="selectedShopHouseShow.ftl?townCode=${town}"
                   style="font: inherit">${allShopHouseAreaSum}</td>
            <td><a href="selectedStorageRoomShow.ftl?townCode=${town}"
                   style="font: inherit">${allStorageRoomCountSum}</td>
            <td><a href="selectedStorageRoomShow.ftl?townCode=${town}"
                   style="font: inherit">${allStorageRoomAreaSum}</td>
            <td><a href="selectedCarLotShow.ftl?carLotType=1,2,3&townCode=${town}"
                   style="font: inherit">${allPtCarLotCountSum}</td>
            <td><a href="selectedCarLotShow.ftl?carLotType=4,5,6&townCode=${town}"
                   style="font: inherit">${allRfCarLotCountSum}</td>
            <td><a href="selectedCarLotShow.ftl?townCode=${town}"
                   style="font: inherit">${allCarLotCountSum}</td>
        </tr>
    </table>
</div>

